<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // 无论如何都能被执行
    // 还是一个promise能够被.then
    Promise.finally = function(reason) {
      return new Promise((resolve, reject) => {
        reject(reason)
      })
    }
    let p1 = Promise.reject(123) // 返回的仍旧是fulfilled状态
    console.log(p1, 'p1');
  </script>
</body>
</html>